<?php
Class PhenotypePereDAO
{
	public $connexion;

	public function __construct()
	{
		try {
			$this->connexion = new PDO("mysql:host=".SERVEUR_MYSQL.";dbname=".BASE.";charset=utf8", UTILISATEUR, M2P);
		}
		catch(PDOException $e)
		{
			echo "Erreur : ".$e->getMessage();
			die();
		}
	}


	public function rechercher_phenotype_pere($idPhenotypePere = null)
	{
		$query = "SELECT * "
		."FROM phenotype_pere WHERE 1 ";
		if ($idPhenotypePere != null){
			$query .= " AND idphenotypepere = :idPhenotypePere ";
		}
		$requette_preparee = $this->connexion->prepare($query);
		if ($idPhenotypePere != null){
			$requette_preparee->bindValue(":idPhenotypePere" , $idPhenotypePere, PDO::PARAM_INT);
		}
		$requette_preparee->execute();
		$typeHerites = $requette_preparee->fetchAll(PDO::FETCH_CLASS,'PhenotypePere');
		return  $typeHerites;

	} // rechercher_phenotype_pere


} // PhenotypePereDAO



?>
